package cn.laowen.org.domain;

import cn.laowen.basic.domain.BasicDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class Department extends BasicDomain {
    //1.id字段每个domain对象都有 继承公共类

    //部门编号
    @ApiModelProperty("部门编号")
    private String sn;
    //部门名称
    @ApiModelProperty("部门名称")
    private String name;
    //部门的上级分类层级id
    @ApiModelProperty("部门的上级分类层级id")
    private String dirPath;
    //部门状态，0正常，1禁用
    @ApiModelProperty("部门状态，0正常，1禁用")
    private Integer state;

    //部门管理员，关联Employee表id
    @ApiModelProperty("部门管理员，关联Employee表id")
    private Long manager_id;
    private Employee manager;//部门管理员

    //上级部门
    @ApiModelProperty("上级部门")
    private Long parent_id;
    private Department parent;//上级部门

    //子数据们
    @JsonInclude(JsonInclude.Include.NON_EMPTY)//前端上级部门最后一页空数据不展示
    private List<Department> children = new ArrayList<>();

    //店铺id
    @ApiModelProperty("店铺id")
    private Long shop_id;


}
